package doc

import (
	"gitee.com/dreamwood/jxgo/v1/mgorm"
)

var demoConfig = mgorm.DocConfig{
	GetFactory: func() mgorm.Factory {
		return *NewDemo().DocGetFactory()
	},
	RelationConfigs: map[string]*mgorm.DocRelation{
		"cat": &mgorm.DocRelation{
			DocName: "DemoCat",
			Config: func() *mgorm.DocConfig {
				return &demoCatConfig
			},
			JoinType: "O",
		},
	},
}

var demoCatConfig = mgorm.DocConfig{
	GetFactory: func() mgorm.Factory {
		return *NewDemoCat().DocGetFactory()
	},
	RelationConfigs: map[string]*mgorm.DocRelation{
		"tag": &mgorm.DocRelation{
			DocName: "DemoTag",
			Config: func() *mgorm.DocConfig {
				return &demoTagConfig
			},
			JoinType: "M",
		},
	},
}

var demoTagConfig = mgorm.DocConfig{
	GetFactory: func() mgorm.Factory {
		return *NewDemoTag().DocGetFactory()
	},
}
